//
//  main.swift
//  Swift01
//
//  Created by 陈永红15180601024 on 2017/9/11.
//  Copyright © 2017年 Apple. All rights reserved.
//

import Foundation
func getname(length:Int) -> String {
    let charSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
    var c = charSet.characters.map { String($0) }
    var s:String = ""
    for _ in (1...length) {
        s.append(c[Int(arc4random()) % c.count])
    }
    return s
    
}
func getage(min: Int, max: Int) -> Int {
    
    let y = arc4random() % UInt32(max) + UInt32(min)
    return Int(y)
}
public class girl
{
    private var Name:String
    private var Age:Int
    
    init(Name:String,Age:Int)
    {
        self.Name = Name
        self.Age = Age
    }
    
    public func date()
    {
        print("约会 ： 名字：\(self.Name) 年龄：\(self.Age)")
    }
}


for i in 0...999
{
    let girlfriend  =  girl(Name:getname(length:5),Age:getage(min:15,max:39))
    girlfriend.date()
}
